home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / libs / sphigs / sph_quik.lha / quickdraw / src / misc_calls.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-12-09  |  1.4 KB  |  67 lines

  1. /*------------------------------- misc_calls.c -------------------------------*/
  2. /* Copyright 1989 Brown University -- Jeffrey Vogel                           */
  3. /*----------------------------------------------------------------------------*/
  4.  
  5. /*--------------------------------- Includes ---------------------------------*/
  6. /*----------------------------------------------------------------------------*/
  7.  
  8. #include "qd_local.h"
  9.  
  10. /*---------------------------------- Random ----------------------------------*/
  11. /*----------------------------------------------------------------------------*/
  12.  
  13. int
  14. Random()
  15. {
  16.    if (!QDrunning)
  17.       QDerror("ERROR WaitDraw: QuickDraw never initialized.");
  18.    return (random() % 32767);
  19. }
  20.  
  21.  
  22. /*-------------------------------- Randomize ---------------------------------*/
  23. /*----------------------------------------------------------------------------*/
  24.  
  25. void
  26. Randomize(seed)
  27. int   seed;
  28. {
  29.    if (!QDrunning)
  30.       QDerror("ERROR Randomize: QuickDraw never initialized.");
  31.    if (seed)
  32.       srandom(seed);
  33.    else
  34.       srandom((int) time(NULL));
  35. }
  36.  
  37.  
  38. /*--------------------------------- WaitDraw ---------------------------------*/
  39. /*----------------------------------------------------------------------------*/
  40.  
  41. void
  42. WaitDraw(n)
  43. int  n;
  44. {
  45.    if (!QDrunning)
  46.       QDerror("ERROR WaitDraw: QuickDraw never initialized.");
  47.    sleep(n);
  48. }
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.